package com.example.j2eeapps.services;

import javax.faces.event.AjaxBehaviorEvent;

import com.example.j2eeapps.domain.UserEntity;

/**
 * Service providing service methods to work with user data and entity
 * @author teo.l.c
 *
 */
public interface UserService {
	/**
	 * Create user persist to database
	 * $@param userEntity
	 * $@return true if success
	 */
	boolean createUser(UserEntity userEntity);
	
	/**
	 * Check user name availability. UI ajax use
	 * @param event
	 * @return
	 */
	boolean checkAvailable(AjaxBehaviorEvent event);
	
	/**
	 * Retrieve full user record from database by user name
	 * @param userName
	 * @return UserEntity
	 */
	UserEntity loadUserEntityByUsername(String userName);
	

}
